package twentytwenty;

import java.util.Arrays;

/**
 * @Author: Zahi
 * @Description:
 * @Date Created in 2020-12-16 13:48
 * @Modified By:
 */
public class MinMoves_453 {
    public static void main(String [] args){
        int [] nums = new int[]{1,4,4};
        System.out.println(minMoves(nums));
    }

    public static int minMoves(int [] nums){
        Arrays.sort(nums);
        int count = 0;
        for (int i = nums.length - 1; i > 0; i--) {
            count += nums[i] - nums[0];
        }
        return count;
    }
}
